#pragma once

struct pArray
{
	int      n;
	int      count;
	pArray * GetAt(int IDx)
	{
		if (IDx > count)return NULL;
		return (pArray*)*(PINT)((int)this + 8 + IDx * 4);
	}
};

char* CloneTextData(char* ps);
char* CloneTextData(char* ps, INT nTextLen);
LPBYTE CloneBinData(LPBYTE pData, INT nDataSize);
void GReportError(char* szErrText);
void* MMalloc(INT nSize);
void MFree(void* p);
LPBYTE MMallocArray(int nCount);
LPBYTE GetAryElementInf(void* pAryData, LPINT pnElementCount);
INT GetDataTypeType(DATA_TYPE dtDataType);
LPBYTE GetBinPtr(PMDATA_INF pArgInf);
DWORD  GetDataSize(PMDATA_INF pArgInf);
void CopyData(PMDATA_INF pArgInf, LPBYTE lpData, DWORD dwSize);